package com.wiscamp.ninechapters.threeparties.mathpix;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;

@Data
public class OCRResponse implements Serializable {
    private static final long serialVersionUID = 8392125410741533737L;
    private String error;
    private String text;
    private String text_display;
    private String latex_styled;
    private double latex_confidence;
    private ArrayList<String> detection_list;

    OCRResponse(String error, String text, String text_display, String latex_styled, double latex_confidence, ArrayList<String> detection_list) {

        this.error = error;
        this.text = text;
        this.text_display = text_display;
        this.latex_styled = latex_styled;
        this.latex_confidence = latex_confidence;
        this.detection_list = detection_list;

    }

    /**
     * @return if no equation in the image.
     */
    Boolean is_not_math() {
        return detection_list.contains("is_not_math");
    }
}
